package com.konne.nightmare.FastPublicOpinion.mvp.presenter;

import android.os.Handler;

import com.blankj.utilcode.util.ActivityUtils;
import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpPresenter;
import com.konne.nightmare.FastPublicOpinion.bean.MembersBean;
import com.konne.nightmare.FastPublicOpinion.mvp.view.ICGMFreeView;
import com.konne.nightmare.FastPublicOpinion.ui.dialog.EditGroupNameDialog;

import java.util.ArrayList;
import java.util.List;

/**
 * Create by ws.
 * on Data:2022/1/25  Time:下午 5:08.
 * description: ** .
 */
public class CGMFreePersenter extends BaseMvpPresenter<ICGMFreeView> {
    private List<MembersBean> students;
    public void init(){
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                students=testGetStudents();
                getView().updataStudent(students,students.size());
            }
        },500);
    }
    private List<MembersBean> testGetStudents(){
        List<MembersBean> teachers=new ArrayList<>();
        MembersBean bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2Fa7%2F57%2F85%2Fa757850a29db44013a12ae694c12490f.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=16a15a471d03f722fb59921f8d847d1a");
        bean.setName("学生1");
        teachers.add(bean);
        bean=new MembersBean();
        bean.setAvatar("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.bq233.com%2Fkanqq%2Fpic%2Fupload%2F2018%2F0723%2F1532329172809328.jpg&refer=http%3A%2F%2Fimg.bq233.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1645609764&t=1f5daa4d0a127ba306e5b5c1a4228729");
        bean.setName("学生2");
        teachers.add(bean);
        return teachers;
    }

    public void renameGroupName() {
        new EditGroupNameDialog(ActivityUtils.getTopActivity()).setEditGroupNameListener(new EditGroupNameDialog.EditGroupNameListener() {
            @Override
            public void groupName(String txt) {

            }
        }).show();
    }

    public void delGroup() {
    }
}
